const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: {
    main: './electron/main.js',
    preload: './electron/preload.js'
  },
  output: {
    filename: '[name].js',
    path: path.resolve(__dirname, 'electron-dist'),
    clean: false
  },
  target: 'electron-main',
  node: {
    __dirname: false,
    __filename: false
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader'
        }
      }
    ]
  },
  mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
  optimization: {
    minimize: false,
    usedExports: false
  },
  devtool: false
};